package com.threeox.commonlibrary.ui.view.inter.pullrefresh;

import android.view.View;

import com.threeox.commonlibrary.entity.engine.model.listmodel.ListModelMsg;

/**
 *
 * @ClassName: IPullToRefLayout
 *
 * @Description: Todo(上拉加载更多和下拉刷新的接口)
 *
 * @author 赵屈犇
 *
 * @date 创建时间:2017/3/6 9:23
 *
 * @version 1.0
 */
public interface IPullToRefLayout {

    // 初始状态
    public static final int INIT = 0;
    // 释放刷新
    public static final int RELEASE_TO_REFRESH = 1;
    // 正在刷新
    public static final int REFRESHING = 2;
    // 释放加载
    public static final int RELEASE_TO_LOAD = 3;
    // 正在加载
    public static final int LOADING = 4;
    // 操作完毕
    public static final int DONE = 5;
    // 刷新成功
    public static final int SUCCEED = 0;
    // 刷新失败
    public static final int FAIL = 1;

    /**
     * 显示头布局
     */
    void showHeader();

    /**
     * 加载完毕，显示加载结果
     *
     * @param loadMoreResult
     * @param msg
     */
    void loadmoreFinish(int loadMoreResult, String msg);

    /**
     * 完成刷新操作
     * @param refreshResult
     * @param msg
     */
    void refreshFinish(int refreshResult, String msg);

    /**
     * 设置上拉和下拉的状态
     *
     * @param headerFooterType
     */
    void setHeaderFooterType(String headerFooterType);

    /**
     *  得到加载数据的View
     *
     * @param <T>
     * @return
     */
    <T extends View> T getMainView();

    /**
     * 设置列表模型
     *
     * @param listModelMsg
     */
    void setListModelMsg(ListModelMsg listModelMsg);

    /**
     * 设置隐藏或显示
     *
      * @param visibility
     */
    void setVisibility(int visibility);

}
